﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HomeMobile.aspx.cs" Inherits="RealIceMobile.HomeMobile" %>

<%@ Register Assembly="C1.Web.iPhone.3" Namespace="C1.Web.iPhone.C1ViewPort" TagPrefix="cc2" %>
<%@ Register Assembly="C1.Web.iPhone.3" Namespace="C1.Web.iPhone.C1NavigationList"
    TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>C1 Sample App</title>
</head>
<body>

    <script type="text/javascript">
    
        // handler for checkable items
        function ItemChecked(item) {
            var id = item.get_commandName();
            if (id == "google" || id == "yahoo") {
                if(item.get_checked()) {
                    // get the owner (the group)
                    var owner = item.get_owner();
                    // get the groups owner (the Search Engine Item)
                    owner = owner.get_owner();
                    // update the detail text
                    owner.set_detailText(item.get_text());
                }
            }
        }

        // handler for clickable items
        function ItemClicked(item) {
            var id = item.get_commandName();
            var text;
            var buttontext;
            switch (id) {
                case "history":                    
                    $().c1iPhone().c1confirm(function(){alert("Clear History confirmed");}, "Are you sure you want to clear history?", {cancel: "Cancel it", ok:"Clear History"});
                    break;
                case "cookie":
                    $().c1iPhone().c1confirm(function(){alert("Clear Cookies confirmed");}, "Are you sure you want to clear all cookies?", {ok:"Clear Cookies"});
                    break;
                case "cache":
                    $().c1iPhone().c1confirm(function(){alert("Clear Cache confirmed");}, "Are you sure you want to clear the cache?", {ok:"Clear Cache"});
                    break;
                default:
                    return;
            }
        }
    </script>

    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <cc2:C1ViewPort ID="C1ViewPort1" runat="server" Text="Settings" ToolBarVisible="true">
            <LeftButton Text="Home" ButtonType="Back" />
            <Content>
                <cc1:C1NavigationList ID="C1NavigationList1" runat="server" NavigationListType="RoundedCornersList" Text="Settings"
                    OnClientItemCheckedChanged="ItemChecked" OnClientItemClick="ItemClicked" LoadOnDemand="true">
                    <Items>
                        <cc1:C1NavigationListGroupItem ID="C1NavigationListGroupItem1" runat="server">
                            <Items>
                                <cc1:C1NavigationListItem ID="C1NavigationListItem1" runat="server" Text="Wi-Fi Networks" DetailText="linksys"
                                    ImageUrl="Images/wifi_29x29.png">
                                </cc1:C1NavigationListItem>
                                <cc1:C1NavigationListItem ID="C1NavigationListItem2" runat="server" Text="Fetch New Data" DetailText="Off" ImageUrl="Images/fetchnewdata_29x29.png">
                                </cc1:C1NavigationListItem>
                            </Items>
                        </cc1:C1NavigationListGroupItem>
                        <cc1:C1NavigationListGroupItem>
                            <Items>
                                <cc1:C1NavigationListItem ID="C1NavigationListItem3" runat="server" Text="Brightness" ImageUrl="Images/brightness_29x29.png">
                                    <Items>
                                        <cc1:C1NavigationListGroupItem ID="C1NavigationListGroupItem2" runat="server">
                                            <Items>
                                                <cc1:C1NavigationListSliderItem ID="C1NavigationListSliderItem1" runat="server">
                                                    <Slider ID="Slider1" runat="server" Value="50" MinimumValue="0" MaximumValue="100">
                                                        <DecrementButton ImageUrl="Images/slider_left_brightness.png" />
                                                        <IncrementButton ImageUrl="Images/slider_right_brightness.png" />
                                                    </Slider>
                                                </cc1:C1NavigationListSliderItem>
                                                <cc1:C1NavigationListSwitchItem ID="C1NavigationListSwitchItem1" runat="server" Text="Auto-Brightness">
                                                </cc1:C1NavigationListSwitchItem>
                                            </Items>
                                        </cc1:C1NavigationListGroupItem>
                                    </Items>
                                </cc1:C1NavigationListItem>
                            </Items>
                        </cc1:C1NavigationListGroupItem>
                        <cc1:C1NavigationListGroupItem>
                            <Items>
                                <cc1:C1NavigationListItem ID="C1NavigationListItem4" runat="server" Text="General" ImageUrl="Images/settings_29x29.png">
                                </cc1:C1NavigationListItem>
                                <cc1:C1NavigationListItem ID="C1NavigationListItem5" runat="server" Text="Music" ImageUrl="Images/music_29x29.png">
                                </cc1:C1NavigationListItem>
                                <cc1:C1NavigationListItem ID="C1NavigationListItem6" runat="server" Text="Video" ImageUrl="Images/videos_29x29.png">
                                </cc1:C1NavigationListItem>
                                <cc1:C1NavigationListItem ID="C1NavigationListItem7" runat="server" Text="Photos" ImageUrl="Images/photos_29x29.png">
                                </cc1:C1NavigationListItem>
                                <cc1:C1NavigationListItem ID="C1NavigationListItem8" runat="server" Text="Mail, Contacts, Calendars" ImageUrl="Images/mail_29x29.png">
                                </cc1:C1NavigationListItem>
                                <cc1:C1NavigationListItem ID="C1NavigationListItem9" runat="server" Text="Safari" ImageUrl="Images/safari_29x29.png">
                                    <Items>
                                        <cc1:C1NavigationListGroupItem ID="C1NavigationListGroupItem3" runat="server" Text="General">
                                            <Items>
                                                <cc1:C1NavigationListItem ID="C1NavigationListItem10" runat="server" Text="Search Engine" DetailText="Google">
                                                    <Items>
                                                        <cc1:C1NavigationListGroupItem ID="C1NavigationListGroupItem4" runat="server">
                                                            <Items>
                                                                <cc1:C1NavigationListOptionItem ID="C1NavigationListOptionItem1" runat="server" Text="Google" Checked="true" CommandName="google">
                                                                </cc1:C1NavigationListOptionItem>
                                                                <cc1:C1NavigationListOptionItem ID="C1NavigationListOptionItem2" runat="server" Text="Yahoo!" CommandName="yahoo">
                                                                </cc1:C1NavigationListOptionItem>
                                                            </Items>
                                                        </cc1:C1NavigationListGroupItem>
                                                    </Items>
                                                </cc1:C1NavigationListItem>
                                            </Items>
                                        </cc1:C1NavigationListGroupItem>
                                        <cc1:C1NavigationListGroupItem ID="C1NavigationListGroupItem5" runat="server" Text="Security">
                                            <Items>
                                                <cc1:C1NavigationListSwitchItem ID="C1NavigationListSwitchItem2" runat="server" Text="JavaScript" Checked="true">
                                                </cc1:C1NavigationListSwitchItem>
                                                <cc1:C1NavigationListSwitchItem ID="C1NavigationListSwitchItem3" runat="server" Text="Plug-Ins" Checked="true">
                                                </cc1:C1NavigationListSwitchItem>
                                                <cc1:C1NavigationListSwitchItem ID="C1NavigationListSwitchItem4" runat="server" Text="Block Pop-ups" Checked="true">
                                                </cc1:C1NavigationListSwitchItem>
                                            </Items>
                                        </cc1:C1NavigationListGroupItem>
                                        <cc1:C1NavigationListGroupItem ID="C1NavigationListGroupItem6" runat="server">
                                            <Items>
                                                <cc1:C1NavigationListButtonItem ID="C1NavigationListButtonItem1" runat="server" Text="Clear History" CommandName="history">
                                                </cc1:C1NavigationListButtonItem>
                                                <cc1:C1NavigationListButtonItem ID="C1NavigationListButtonItem2" runat="server" Text="Clear Cookies" CommandName="cookie">
                                                </cc1:C1NavigationListButtonItem>
                                                <cc1:C1NavigationListButtonItem ID="C1NavigationListButtonItem3" runat="server" Text="Clear Cache" CommandName="cache">
                                                </cc1:C1NavigationListButtonItem>
                                            </Items>
                                        </cc1:C1NavigationListGroupItem>
                                    </Items>
                                </cc1:C1NavigationListItem>
                            </Items>
                        </cc1:C1NavigationListGroupItem>
                    </Items>
                </cc1:C1NavigationList>
            </Content>
        </cc2:C1ViewPort>
    </div>
    </form>
</body>
</html>
